//package com.jike.mahjong.controller;
//
//
//import com.google.gson.Gson;
//import com.google.gson.JsonObject;
//import com.jike.mahjong.common.Page;
//import com.jike.mahjong.common.util.HttpUtil;
//import com.jike.mahjong.model.*;
//import com.jike.mahjong.service.JobService;
//import com.jike.mahjong.service.MessageService;
//import org.apache.log4j.Logger;
//import org.quartz.SchedulerException;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.util.HashMap;
//import java.util.Map;
//
//
///**
// * 游戏消息，公告等内容
// * Created by star on 2016/10/12.
// */
//@Controller
//public class JobMessageController {
//
//    private Logger log = Logger.getLogger(JobMessageController.class);
//
//    @Autowired
//    private JobService jobService;
//
//    /**
//     * 查询
//     *
//     * @param request
//     * @param response
//     * @param message
//     * @param model
//     * @return
//     * @throws Exception
//     */
////注释原因......取消任务调度方式推送公告
////    @RequestMapping(value = "/message/queryMessageList.html", method = {RequestMethod.GET,
////            RequestMethod.POST})
////    protected String queryPlayerList(HttpServletRequest request, HttpServletResponse response, MessageModel message, Model model) throws Exception {
////        Page page=new Page();
////        Map<String, Object> para = new HashMap<String, Object>();
////        String currentPage = HttpUtil.getHttpParameter(request, "pageIndex");
////
////        if(!"".equals(currentPage)&&currentPage!=null){
////            page.setCurrentPage(Integer.parseInt(currentPage));
////
////        }else{
////            page.setCurrentPage(1);
////        }
////        page = jobService.queryJobMessageInfo(para,page);
////        model.addAttribute("page", page);
////        return "views/title/messageShow";
////    }
//
///**
//     * 添加
//     *
//     * @param request
//     * @param response
//     * @param model
//     * @return
//     * @throws Exception
//     */
//    @RequestMapping(value = "/job/addMessageJob.html", method = {RequestMethod.GET,
//            RequestMethod.POST})
//    protected String addMessage(HttpServletRequest request, HttpServletResponse response, Model model,CronJob job) throws Exception {
//        Map<String, Object> para = new HashMap<String, Object>();
//        Manager manager = (Manager) request.getSession().getAttribute("loginUser");
//
//
//        int effectRow=jobService.insertMessageJob(job);
////        int effectRow = messageService.insertMessage(message);
//        model.addAttribute("effectRow", effectRow);
//        Page page=new Page();
//        page.setCurrentPage(1);
//
//        model.addAttribute("page",querAllMessageJob(para,page) );
//        return "views/title/messageShow";
//    }
//
//    @RequestMapping("/job/changeJobStatus.html")
//    @ResponseBody
//    public Model  changeJobStatus(HttpServletRequest request, Long jobId, String cmd, Model model) {
//
//        Gson gson=new Gson();
//        RetObj retObj = new RetObj();
//        retObj.setFlag(false);
//        try {
//            jobService.changeStatus(jobId, cmd);
//        } catch (SchedulerException e) {
//            e.printStackTrace();
//        }
//        retObj.setFlag(true);
//        String resultJons=gson.toJson(retObj);
//        model.addAttribute("retObj",retObj);
////        return resultJons;
//        return model;
//    }
//
//    @RequestMapping("/job/deleteMessageJob.html")
//    public String deleteJob (HttpServletRequest request, Long jobId,Model model) {
//        Map<String, Object> para = new HashMap<String, Object>();
//        try {
//            jobService.deleteMessageJob(jobId);
//        } catch (SchedulerException e) {
//            e.printStackTrace();
//        }
//        Page page=new Page();
//        page.setCurrentPage(1);
//        model.addAttribute("page",querAllMessageJob(para,page) );
//        return "views/title/messageShow";
//    }
//
//
//
//    public Page querAllMessageJob(Map<String, Object> para,Page page){
//
//        page = jobService.queryJobMessageInfo(para,page);
//        return page;
//    }
//
//
//
//}
